home *** CD-ROM | disk | FTP | other *** search
/ Best of Shareware / Best of PC Windows Shareware 1.0 - Wayzata Technology (7111) (1993).iso / mac / ZIPPED / DOS / GRAPHICS / LISS151.ZIP / LISSAJOU.DOC next >
Text File  |  1992-04-21  |  11KB  |  301 lines

  1.      Lissajous V1.51
  2.      April 21, 1992
  3.      By Aaron Caba and Dan Farmer
  4.  
  5. Disclaimer:
  6.  
  7. This program is worth every cent that you payed for it!  If
  8. something breaks when you use this, I'll refund 100% of your
  9. payment.  Other than that, I will not be held responsible if
  10. Lissajous causes any damage to your system.  
  11.  
  12. =================================================================
  13.  
  14. Description:
  15.  
  16. Lissajous generates 3-D Lissajous patterns for output into ray-
  17. tracing format.  A Lissajous pattern is a periodic pattern
  18. gennerated using sines and cosines as a function of time.  (Got
  19. that?  Didn't think so)  If you want to know how it works and
  20. maybe gain some insight as to why the patterns turned out the way
  21. they did, see the 'How it Works' section near the end of this
  22. document.
  23.  
  24.  
  25. The following output formats are supported: 
  26.  
  27.    * Vivid ray tracer (Ver. 1.0, Copyright 1989-1992 Stephen B.
  28.      Coy)
  29.  
  30.    * Persistence of Vision (PoV) ray tracer, Versions 0.5ß and
  31.      1.0 (Copyright (c) 1992 POV-Team)
  32.  
  33.    * Connect the Dots Smoother (CTDS) (Ver. 1.6:  Copyright (C)
  34.      1992 By Truman Brown.
  35.  
  36.    * Raw format:  just the (x,y,z) coordinates of the points.
  37.  
  38. =================================================================
  39.  
  40. How to use Lissajous:
  41.  
  42. There are 2 main parts to Lissajous, the Editing/Viewing screen,
  43. and the Data File Output screen.  The E/V screen is where you
  44. edit the parameters and view the figure generated by those
  45. parameters.  On the Data File Output screen, you can choose the
  46. output file format.
  47.  
  48. =================================================================
  49.  
  50. Edit/Viewing screen:
  51.  
  52. The editing/viewing screen is the first thing you see when you
  53. start the program.  The generation parameters are in the left
  54. window, the viewing window is the empty window, and on the bottom
  55. is the message window.  The equations used to generate the figure
  56. will be listed in the left window also.  (This should be pretty
  57. obvious when you use the program)
  58.  
  59.      Note:  Lissajous uses a RIGHT handed coord system.  On the
  60.      viewing screen, the axis you don't see is pointing OUT of
  61.      the screen.
  62.  
  63. Here's a quick description of each generation parameter:
  64.  
  65. -- R Value:  
  66.      An positive integer that controls the over all size of the
  67.      generated figure.  If R is set to 100, no coordinate will be
  68.      greater than +/-100.
  69.  
  70. -- A Value:
  71.      One of the variables that affects generation:  It changes
  72.      the period of the equations, changing the figure.  It must
  73.      be a positive decimal number.
  74.  
  75. -- B Value:
  76.      Like the A variable, but it is used in different places in
  77.      the equations.
  78.  
  79. -- X, Y, Z-Exponent:
  80.      These are exponents in the generation functions.  They apply
  81.      to the x, y, and z coordinate equations respectively. 
  82.      Positive integers from 1 to 9.
  83.  
  84. -- Sphere Rad:  
  85.      This controls the size of the spheres that make-up the
  86.      figure.  Positive ints from 1 to 99.
  87.  
  88. -- # of Spheres:
  89.      Use this to say how many spheres/dots you want in the
  90.      generated figure.  The more spheres you have, the smoother
  91.      it looks, but at the expense of a longer tracing time.
  92.  
  93. -- View (X,Y,Z):
  94.      Change the viewing perspective to the x, y, or z axis.  Use
  95.      this to get a good look at what you have created.
  96.  
  97. -- Method (1-5):
  98.      To choose which set of generating functions to use.  See
  99.      'How it Works'.
  100.  
  101. To create a figure, edit the parameters to something promising,
  102. and either hit PageDown, or use the arrow keys to go past the
  103. last parameter.  
  104.  
  105.      Note:  The PageUp key will take you to the top of the
  106.      list.
  107.  
  108.  
  109. Hints:
  110.  
  111. To create good looking pictures, it is advisable (but not
  112. necessary) to have A and B be multiples of some common factor, or
  113. be a simple ratio such as 4:5, 1:3,  etc.  Also, the picture
  114. doesn't depend on what A and B are explicitly, only on the ratio
  115. A/B (except for algorithm 4, I think).  So, if the dots don't
  116. seem to be very spread out around the figure, try multiplying or
  117. dividing both A and B by the same factor.  (ie:  if A=4 & B=5,
  118. try A=8 & B=10 or A=2 & B=2.5)  If you do this a couple of times,
  119. the dots will spread themselves out.
  120.  
  121. Along that note, if you use the CTDS or the Smooth Vivid output
  122. option (see Data File Output below), you can probably reduce the
  123. number of spheres generated by a factor of 2 (maybe even 3) and
  124. still have a relatively smooth looking figure.
  125.  
  126.      Note:  Generally, the closer the ratio A/B gets to 1,
  127.      the more spheres you will need to resolve the figure.
  128.  
  129.      Note:  Your 'viewing position' in the view window is at
  130.      +300, so if you set R to 300 or greater, weird things
  131.      will happen.  Don't worry:  even though the preview
  132.      looks weird, the output files will be OK. 
  133.  
  134. After the spheres are drawn, the message window will display:
  135. "Finished:  [O]=Output script  [R]=Rotate  [CR]=More  [ESC]=Quit"
  136.  
  137. -- O:
  138.      Takes you to the Data File Output screen (see below).
  139.  
  140. -- R:
  141.      This will allow you to rotate the figure.  Simply input your
  142.      desired rotation at the prompt and press <enter>.
  143.  
  144. -- CR:
  145.      Also know as <Return> and <Enter>.  This will take you back
  146.      to editing the data.
  147.  
  148. -- ESC:
  149.      Go figure.
  150.  
  151. =================================================================
  152.  
  153. Data File Output screen:
  154.  
  155. "Script file type:  [P]oV  [V]ivid  [C]TDS  [R]aw"
  156.  
  157. First choose what format you want the output file in: PoV, Vivid,
  158. CTDS or Raw.  After that, input a file name, up to 8 characters. 
  159. The appropriate file extension will be added on.  
  160.  
  161. -- PoV:
  162.      First give what version of PoV you are using.  Then you will
  163.      be asked for the number of colors to use.  At the following
  164.      prompts, input either a declared color constant (eg. CRed,
  165.      Yellow, DarkOrchid, etc) or input your own RGB color values,
  166.      exactly as you would in a PoV data file.
  167.  
  168. -- Vivid:
  169.      You will have 2 options at this point:  [S]mooth or [B]eaded
  170.      Smooth:  This will produce CTDS style output for Vivid. 
  171.      Each sphere will be connected to the two next to it with a
  172.      cylinder, to give the impression that the figure is smooth.
  173.      Beaded:  This will just output the sphere definitions.
  174.  
  175. -- CTDS:
  176.      The file will be written immediately after you enter the
  177.      output file name.
  178.  
  179. -- Raw:
  180.      You have two options on the order of the 'raw' coordinates: 
  181.      "Sort data on:  View-[A]xis or [C]TDS style".  The Z-Axis
  182.      will write the points in the same order that they are
  183.      displayed on the 'Editing and Viewing screen' ie. from
  184.      farthest to closest, on the Z component.
  185.  
  186.      The CTDS style will sort the spheres in order as if you were
  187.      to trace around the figure once.  (the last point in the
  188.      list will be next to the first)
  189.  
  190.      The Raw format is simply a listing of the (x,y,z)
  191.      coordinates of all the generated points in the following
  192.      (ASCII) format:
  193.       -31.386734   -21.351656   -92.514755
  194.        33.689098    20.799326   -91.828278
  195.      -817.685364  -569.559448    70.666443
  196.       -35.990498   -20.077362   -91.113029
  197.       -38.279678    19.185160   -90.369217
  198.        40.545330   -18.122829   -89.597092
  199.        50.144905    11.279497   -85.780312
  200.       -52.081665    -9.315856   -84.857025
  201.         0.158359     7.953411  -998.968323
  202.      ^   ^            ^            ^  
  203.      │   │            │            └─ Z component
  204.      │   │            └─ Y component            
  205.      │   └─ X component
  206.      └─ Left most character
  207.  
  208.      Each field is 11 characters wide with 2 spaces between the
  209.      fields.
  210.  
  211. =================================================================
  212.  
  213. How to use the output files:
  214.  
  215. The PoV and Vivid files are written so they are ready to be
  216. traced.  Just plug them into their respective raytracers, and sit
  217. and enjoy.  If you don't like the default camera position,
  218. lighting, etc., then change them.  I just put those into the
  219. program so a novice could get quick results.
  220.  
  221. When using the CTDS files, be sure to use the /c option.  The /c
  222. will connect the first and last dots, closing the figure.  To let
  223. the /m parameter do its job, it will be necessary to put breaks
  224. after every 5th to 10th sphere (or whatever you want), so CTDS
  225. can generate useful bounding spheres.
  226.  
  227. I don't have any use for the .RAW files right now, but Dan
  228. suggested that I put them in, in case some other entrepreneurial
  229. soul decides that there is a use for it.  (It was easy to code
  230. too!)
  231.  
  232. =================================================================
  233.  
  234. How it all works:
  235.  
  236. Remember using an Etch-a-Sketch?  You had two knobs.  One
  237. controlled the X position of the cursor, and the other the Y
  238. position.  Now twist the X knob back and forth.  The cursor will
  239. move left and right in a straight line.  Now if you twist the Y
  240. knob at the same time, you end up with a curve on the screen.  If
  241. you were careful, you could draw a pretty good circle by turning
  242. the knobs smoothly back and forth.
  243.  
  244. Lissajous patterns are generated in much the same fassion.  I'm
  245. going to stick to the 2-D here but the 3-D is simmalar.  What
  246. Lissajous does is move the X and Y knobs slowly back and forth
  247. according to the built in equations (see 'How it Works').  If you
  248. move the Y knob twice as fast as the X knob, you will generate a
  249. figure 8.
  250.  
  251. For the 3-D, it is the same as above, but with another knob on
  252. the Etch-a-Sketch that moves the cursor toward and away from you. 
  253. (You either need another hand, or a friend to try this one ;-) )
  254.  
  255. A 3-D Lissajous figure is created using 3 parametric equations, 1
  256. each for the x, y, and z coordinates.  These equations are
  257. functions of sin and cos, so they are periodic, with the actual
  258. period depending on what values you enter.  The values you input
  259. in these functions are: a, b, and exponent_x/y/z.  The value of
  260. 't' is the parameter, and ranges from 0 to # of spheres-1.  
  261.  
  262. Here are the coordinate functions, by algorithm number:
  263.  
  264. 1)
  265. x = r * (sin(a*t) * (cos(b*t)^exponent_x))
  266. y = r * (sin(a*t) * (sin(b*t)^exponent_y))
  267. z = r * (cos(a*t)^exponent_z)
  268.  
  269. 2)
  270. x = r * (sin(a*t) * (cos(b*t)^exponent_x))
  271. y = r * (cos(a*t) * (cos(b*t)^exponent_y))
  272. z = r * (sin(a*t)^exponent_z)
  273.  
  274. 3)
  275. x = r * (sin(a*t) * (sin(b*t)^exponent_x))
  276. y = r * (sin(a*t) * (cos(b*t)^exponent_y))
  277. z = r * (sin(a*t)^exponent_z);
  278.  
  279. 4)
  280. x = r/4 * (a * sin(2*(t-PI/13))^exponent_x)
  281. y = r/4 * (-b * cos(t)^exponent_y)
  282. z = r   * (sin(a*t)^exponent_z)
  283.  
  284. 5)
  285. x = r * (sin(a*t) * (cos(a*t)^exponent_x))
  286. y = r * (sin(b*t) * (sin(b*t)^exponent_y))
  287. z = r * (sin(t)^exponent_z)
  288.  
  289. =================================================================
  290.  
  291. Well, that's about all I have to say.  If you have any comments,
  292. suggestions, etc., please contact me at:  
  293.  
  294.      Mind Image BBS:  (612) 781-1720   ADEnet, CompuGFX echo
  295.      (or any ADEnet board)
  296.  
  297.      10121 Laurel Drive
  298.      Eden Prairie, MN  55347
  299.  
  300. Aaron C. Caba 
  301.